/*
 * Copyright (c) 2005, 2014 vacoor
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.vacoor.nothing.web.misc.cg.descriptor;

/**
 * 关联关系
 *
 * @author vacoor
 */
public abstract class Relationship {
    final String source;// 定义源
    protected boolean fetch;      // 是否抓取关联对象
    protected boolean optional;   // 关联对象是否是可选的
    protected String mappedBy;    // 关系又关联对象的哪个属性维护

    protected String property;    // 映射属性
    protected String joinColumn;  // 连接列
    protected MappedTable rel;          // 关联表

    protected Relationship(String source) {
        this.source = source;
    }

    public boolean isFetch() {
        return fetch;
    }

    public void setFetch(boolean fetch) {
        this.fetch = fetch;
    }

    public boolean isOptional() {
        return optional;
    }

    public void setOptional(boolean optional) {
        this.optional = optional;
    }

    public String getMappedBy() {
        return mappedBy;
    }

    public void setMappedBy(String mappedBy) {
        this.mappedBy = mappedBy;
    }

    public String getProperty() {
        return property;
    }

    public void setProperty(String property) {
        this.property = property;
    }

    public MappedTable getRel() {
        return rel;
    }

    public void setRel(MappedTable rel) {
        this.rel = rel;
    }

    public String getJoinColumn() {
        return joinColumn;
    }

    public void setJoinColumn(String joinColumn) {
        this.joinColumn = joinColumn;
    }
}
